<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <!-- 2 写一个标签 文本域标签 -->
  <textarea id="mytextarea">Hello, World!</textarea>

  <button>获取富文本内的内容</button>


  <!-- 1 引入js文件 -->
  <script src="../libs/tinymce_5.5.1/tinymce.min.js"></script>

  <!-- 3 自己写js 初始化 -->
  <script>
    tinymce.init({
      selector: '#mytextarea',
      language: 'zh_CN',//注意大小写
    });


    document.querySelector("button").onclick = function () {
      var cnt = tinyMCE.editors["mytextarea"].getContent();
      console.log(cnt);
    }
  </script>
</body>

</html>